import request from '@/utils/request'

// 查询接入平台列表
export function selectPlatform(query) {
  return request({
    url: '/third/platform/select',
    method: 'get',
    params: query
  })
}

// 查询接入平台列表
export function listPlatform(query) {
  return request({
    url: '/third/platform/list',
    method: 'get',
    params: query
  })
}

// 查询接入平台详细
export function getPlatform(id) {
  return request({
    url: '/third/platform/' + id,
    method: 'get'
  })
}

// 新增接入平台
export function addPlatform(data) {
  return request({
    url: '/third/platform',
    method: 'post',
    data: data
  })
}

// 修改接入平台
export function updatePlatform(data) {
  return request({
    url: '/third/platform',
    method: 'put',
    data: data
  })
}

// 删除接入平台
export function delPlatform(id) {
  return request({
    url: '/third/platform/' + id,
    method: 'delete'
  })
}

// 启动/停止 接入平台
export function triggerPlatform(cmd, id) {
  return request({
    url: '/third/platform/'+cmd +'/' + id,
    method: 'get'
  })
}
